﻿#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "emqxcontroller.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
private slots:
    void on_btnStart_clicked();
    void on_btnStop_clicked();
    void on_btnRestart_clicked();
    void on_btnInstall_clicked();
    void on_btnUninstall_clicked();
    void on_btnRefresh_clicked();
    void on_autoStartCheckBox_toggled(bool checked);

    void handleOutput(const QString &output);
    void handleError(const QString &error);
    void handleStatusChanged(EmqxController::Status status);

private:
    Ui::Widget *ui;
    EmqxController *emqx;
    void updateStatusDisplay();

};
#endif // WIDGET_H
